function SecureRandom() {}


function RSAKey() {
    this.n = null;
    this.e = 0;
    this.d = null;
    this.p = null;
    this.q = null;
    this.dmp1 = null;
    this.dmq1 = null;
    this.coeff = null
}
RSAKey.prototype.doPublic = RSADoPublic;
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
RSAKey.prototype.encryptOAEP = RSAEncryptOAEP;
RSAKey.prototype.type = "RSA";
RSAKey.prototype.doPrivate = RSADoPrivate;
RSAKey.prototype.setPrivate = RSASetPrivate;
RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
RSAKey.prototype.generate = RSAGenerate;
RSAKey.prototype.decrypt = RSADecrypt;
RSAKey.prototype.decryptOAEP = RSADecryptOAEP;
function RSADoPublic(a) {
    return a.modPowInt(this.e, this.n)
}




CryptoJS = require("crypto-js");

_0x595165 = function (_0x4d373a, qccppm) {
    _0x23426d = qccppm["split"]("|");
    var _0x307ab8 = _0x23426d[0]
        , _0x4bb657 = _0x23426d[1]

    var _0x9cc440 = CryptoJS["enc"]["Utf8"]["parse"](_0x307ab8)
        , _0x989408 = CryptoJS.enc["Utf8"]["parse"](_0x4bb657)
        , _0x12f1ea = ""
        , _0x2dd779 = CryptoJS.enc["Utf8"]["parse"](_0x4d373a);
    return _0x12f1ea = CryptoJS.AES["encrypt"](_0x2dd779, _0x9cc440, {
        iv: _0x989408,
        mode: CryptoJS["mode"]["CBC"],
        padding: CryptoJS["pad"]["Pkcs7"]
    }),
        _0x12f1ea["ciphertext"]["toString"]();
}
// ======================= SIGN ============================





var KJUR = {};
if (typeof KJUR == "undefined" || !KJUR) {
    KJUR = {}
}
if (typeof KJUR.crypto == "undefined" || !KJUR.crypto) {
    KJUR.crypto = {}
}
KJUR.crypto.Util = new function() {
    this.DIGESTINFOHEAD = {
        sha1: "3021300906052b0e03021a05000414",
        sha224: "302d300d06096086480165030402040500041c",
        sha256: "3031300d060960864801650304020105000420",
        sha384: "3041300d060960864801650304020205000430",
        sha512: "3051300d060960864801650304020305000440",
        md2: "3020300c06082a864886f70d020205000410",
        md5: "3020300c06082a864886f70d020505000410",
        ripemd160: "3021300906052b2403020105000414",
    };
    this.DEFAULTPROVIDER = {
        md5: "cryptojs",
        sha1: "cryptojs",
        sha224: "cryptojs",
        sha256: "cryptojs",
        sha384: "cryptojs",
        sha512: "cryptojs",
        ripemd160: "cryptojs",
        hmacmd5: "cryptojs",
        hmacsha1: "cryptojs",
        hmacsha224: "cryptojs",
        hmacsha256: "cryptojs",
        hmacsha384: "cryptojs",
        hmacsha512: "cryptojs",
        hmacripemd160: "cryptojs",
        MD5withRSA: "cryptojs/jsrsa",
        SHA1withRSA: "cryptojs/jsrsa",
        SHA224withRSA: "cryptojs/jsrsa",
        SHA256withRSA: "cryptojs/jsrsa",
        SHA384withRSA: "cryptojs/jsrsa",
        SHA512withRSA: "cryptojs/jsrsa",
        RIPEMD160withRSA: "cryptojs/jsrsa",
        MD5withECDSA: "cryptojs/jsrsa",
        SHA1withECDSA: "cryptojs/jsrsa",
        SHA224withECDSA: "cryptojs/jsrsa",
        SHA256withECDSA: "cryptojs/jsrsa",
        SHA384withECDSA: "cryptojs/jsrsa",
        SHA512withECDSA: "cryptojs/jsrsa",
        RIPEMD160withECDSA: "cryptojs/jsrsa",
        SHA1withDSA: "cryptojs/jsrsa",
        SHA224withDSA: "cryptojs/jsrsa",
        SHA256withDSA: "cryptojs/jsrsa",
        MD5withRSAandMGF1: "cryptojs/jsrsa",
        SHA1withRSAandMGF1: "cryptojs/jsrsa",
        SHA224withRSAandMGF1: "cryptojs/jsrsa",
        SHA256withRSAandMGF1: "cryptojs/jsrsa",
        SHA384withRSAandMGF1: "cryptojs/jsrsa",
        SHA512withRSAandMGF1: "cryptojs/jsrsa",
        RIPEMD160withRSAandMGF1: "cryptojs/jsrsa",
    };
    this.CRYPTOJSMESSAGEDIGESTNAME = {
        md5: CryptoJS.algo.MD5,
        sha1: CryptoJS.algo.SHA1,
        sha224: CryptoJS.algo.SHA224,
        sha256: CryptoJS.algo.SHA256,
        sha384: CryptoJS.algo.SHA384,
        sha512: CryptoJS.algo.SHA512,
        ripemd160: CryptoJS.algo.RIPEMD160
    };
    this.getDigestInfoHex = function(a, b) {
        if (typeof this.DIGESTINFOHEAD[b] == "undefined") {
            throw "alg not supported in Util.DIGESTINFOHEAD: " + b
        }
        return this.DIGESTINFOHEAD[b] + a
    }
    ;
    this.getPaddedDigestInfoHex = function(h, a, j) {
        var c = this.getDigestInfoHex(h, a);
        var d = j / 4;
        if (c.length + 22 > d) {
            throw "key is too short for SigAlg: keylen=" + j + "," + a
        }
        var b = "0001";
        var k = "00" + c;
        var g = "";
        var l = d - b.length - k.length;
        for (var f = 0; f < l; f += 2) {
            g += "ff"
        }
        var e = b + g + k;
        return e
    }
    ;
    this.hashString = function(a, c) {
        var b = new KJUR.crypto.MessageDigest({
            alg: c
        });
        return b.digestString(a)
    }
    ;
    this.hashHex = function(b, c) {
        var a = new KJUR.crypto.MessageDigest({
            alg: c
        });
        return a.digestHex(b)
    }
    ;
    this.sha1 = function(a) {
        var b = new KJUR.crypto.MessageDigest({
            alg: "sha1",
            prov: "cryptojs"
        });
        return b.digestString(a)
    }
    ;
    this.sha256 = function(a) {
        var b = new KJUR.crypto.MessageDigest({
            alg: "sha256",
            prov: "cryptojs"
        });
        return b.digestString(a)
    }
    ;
    this.sha256Hex = function(a) {
        var b = new KJUR.crypto.MessageDigest({
            alg: "sha256",
            prov: "cryptojs"
        });
        return b.digestHex(a)
    }
    ;
    this.sha512 = function(a) {
        var b = new KJUR.crypto.MessageDigest({
            alg: "sha512",
            prov: "cryptojs"
        });
        return b.digestString(a)
    }
    ;
    this.sha512Hex = function(a) {
        var b = new KJUR.crypto.MessageDigest({
            alg: "sha512",
            prov: "cryptojs"
        });
        return b.digestHex(a)
    }
}
;
KJUR.crypto.Util.md5 = function(a) {
    var b = new KJUR.crypto.MessageDigest({
        alg: "md5",
        prov: "cryptojs"
    });
    return b.digestString(a)
}
;
KJUR.crypto.Util.ripemd160 = function(a) {
    var b = new KJUR.crypto.MessageDigest({
        alg: "ripemd160",
        prov: "cryptojs"
    });
    return b.digestString(a)
}
;
KJUR.crypto.Util.SECURERANDOMGEN = new SecureRandom();
KJUR.crypto.Util.getRandomHexOfNbytes = function(b) {
    var a = new Array(b);
    KJUR.crypto.Util.SECURERANDOMGEN.nextBytes(a);
    return BAtohex(a)
}
;
KJUR.crypto.Util.getRandomBigIntegerOfNbytes = function(a) {
    return new BigInteger(KJUR.crypto.Util.getRandomHexOfNbytes(a),16)
}
;
KJUR.crypto.Util.getRandomHexOfNbits = function(d) {
    var c = d % 8;
    var a = (d - c) / 8;
    var b = new Array(a + 1);
    KJUR.crypto.Util.SECURERANDOMGEN.nextBytes(b);
    b[0] = (((255 << c) & 255) ^ 255) & b[0];
    return BAtohex(b)
}
;
KJUR.crypto.Util.getRandomBigIntegerOfNbits = function(a) {
    return new BigInteger(KJUR.crypto.Util.getRandomHexOfNbits(a),16)
}
;
KJUR.crypto.Util.getRandomBigIntegerZeroToMax = function(b) {
    var a = b.bitLength();
    while (1) {
        var c = KJUR.crypto.Util.getRandomBigIntegerOfNbits(a);
        if (b.compareTo(c) != -1) {
            return c
        }
    }
}
;
KJUR.crypto.Util.getRandomBigIntegerMinToMax = function(e, b) {
    var c = e.compareTo(b);
    if (c == 1) {
        throw "biMin is greater than biMax"
    }
    if (c == 0) {
        return e
    }
    var a = b.subtract(e);
    var d = KJUR.crypto.Util.getRandomBigIntegerZeroToMax(a);
    return d.add(e)
}
;
KJUR.crypto.MessageDigest = function(c) {
    var b = null;
    var a = null;
    var d = null;
    this.setAlgAndProvider = function(g, f) {
        g = KJUR.crypto.MessageDigest.getCanonicalAlgName(g);
        if (g !== null && f === undefined) {
            f = KJUR.crypto.Util.DEFAULTPROVIDER[g]
        }
        if (":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(g) != -1 && f == "cryptojs") {
            try {
                this.md = KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[g].create()
            } catch (e) {
                throw "setAlgAndProvider hash alg set fail alg=" + g + "/" + e
            }
            this.updateString = function(h) {
                this.md.update(h)
            }
            ;
            this.updateHex = function(h) {
                var i = CryptoJS.enc.Hex.parse(h);
                this.md.update(i)
            }
            ;
            this.digest = function() {
                var h = this.md.finalize();
                return h.toString(CryptoJS.enc.Hex)
            }
            ;
            this.digestString = function(h) {
                this.updateString(h);
                return this.digest()
            }
            ;
            this.digestHex = function(h) {
                this.updateHex(h);
                return this.digest()
            }
        }
        if (":sha256:".indexOf(g) != -1 && f == "sjcl") {
            try {
                this.md = new sjcl.hash.sha256()
            } catch (e) {
                throw "setAlgAndProvider hash alg set fail alg=" + g + "/" + e
            }
            this.updateString = function(h) {
                this.md.update(h)
            }
            ;
            this.updateHex = function(i) {
                var h = sjcl.codec.hex.toBits(i);
                this.md.update(h)
            }
            ;
            this.digest = function() {
                var h = this.md.finalize();
                return sjcl.codec.hex.fromBits(h)
            }
            ;
            this.digestString = function(h) {
                this.updateString(h);
                return this.digest()
            }
            ;
            this.digestHex = function(h) {
                this.updateHex(h);
                return this.digest()
            }
        }
    }
    ;
    this.updateString = function(e) {
        throw "updateString(str) not supported for this alg/prov: " + this.algName + "/" + this.provName
    }
    ;
    this.updateHex = function(e) {
        throw "updateHex(hex) not supported for this alg/prov: " + this.algName + "/" + this.provName
    }
    ;
    this.digest = function() {
        throw "digest() not supported for this alg/prov: " + this.algName + "/" + this.provName
    }
    ;
    this.digestString = function(e) {
        throw "digestString(str) not supported for this alg/prov: " + this.algName + "/" + this.provName
    }
    ;
    this.digestHex = function(e) {
        throw "digestHex(hex) not supported for this alg/prov: " + this.algName + "/" + this.provName
    }
    ;
    if (c !== undefined) {
        if (c.alg !== undefined) {
            this.algName = c.alg;
            if (c.prov === undefined) {
                this.provName = KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]
            }
            this.setAlgAndProvider(this.algName, this.provName)
        }
    }
}
;
KJUR.crypto.MessageDigest.getCanonicalAlgName = function(a) {
    if (typeof a === "string") {
        a = a.toLowerCase();
        a = a.replace(/-/, "")
    }
    return a
}
;
KJUR.crypto.MessageDigest.getHashLength = function(c) {
    var b = KJUR.crypto.MessageDigest;
    var a = b.getCanonicalAlgName(c);
    if (b.HASHLENGTH[a] === undefined) {
        throw "not supported algorithm: " + c
    }
    return b.HASHLENGTH[a]
}
;
KJUR.crypto.MessageDigest.HASHLENGTH = {
    md5: 16,
    sha1: 20,
    sha224: 28,
    sha256: 32,
    sha384: 48,
    sha512: 64,
    ripemd160: 20
};
KJUR.crypto.Mac = function(d) {
    var f = null;
    var c = null;
    var a = null;
    var e = null;
    var b = null;
    this.setAlgAndProvider = function(k, i) {
        k = k.toLowerCase();
        if (k == null) {
            k = "hmacsha1"
        }
        k = k.toLowerCase();
        if (k.substr(0, 4) != "hmac") {
            throw "setAlgAndProvider unsupported HMAC alg: " + k
        }
        if (i === undefined) {
            i = KJUR.crypto.Util.DEFAULTPROVIDER[k]
        }
        this.algProv = k + "/" + i;
        var g = k.substr(4);
        if (":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(g) != -1 && i == "cryptojs") {
            try {
                var j = KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[g];
                this.mac = CryptoJS.algo.HMAC.create(j, this.pass)
            } catch (h) {
                throw "setAlgAndProvider hash alg set fail hashAlg=" + g + "/" + h
            }
            this.updateString = function(l) {
                this.mac.update(l)
            }
            ;
            this.updateHex = function(l) {
                var m = CryptoJS.enc.Hex.parse(l);
                this.mac.update(m)
            }
            ;
            this.doFinal = function() {
                var l = this.mac.finalize();
                return l.toString(CryptoJS.enc.Hex)
            }
            ;
            this.doFinalString = function(l) {
                this.updateString(l);
                return this.doFinal()
            }
            ;
            this.doFinalHex = function(l) {
                this.updateHex(l);
                return this.doFinal()
            }
        }
    }
    ;
    this.updateString = function(g) {
        throw "updateString(str) not supported for this alg/prov: " + this.algProv
    }
    ;
    this.updateHex = function(g) {
        throw "updateHex(hex) not supported for this alg/prov: " + this.algProv
    }
    ;
    this.doFinal = function() {
        throw "digest() not supported for this alg/prov: " + this.algProv
    }
    ;
    this.doFinalString = function(g) {
        throw "digestString(str) not supported for this alg/prov: " + this.algProv
    }
    ;
    this.doFinalHex = function(g) {
        throw "digestHex(hex) not supported for this alg/prov: " + this.algProv
    }
    ;
    this.setPassword = function(h) {
        if (typeof h == "string") {
            var g = h;
            if (h.length % 2 == 1 || !h.match(/^[0-9A-Fa-f]+$/)) {
                g = rstrtohex(h)
            }
            this.pass = CryptoJS.enc.Hex.parse(g);
            return
        }
        if (typeof h != "object") {
            throw "KJUR.crypto.Mac unsupported password type: " + h
        }
        var g = null;
        if (h.hex !== undefined) {
            if (h.hex.length % 2 != 0 || !h.hex.match(/^[0-9A-Fa-f]+$/)) {
                throw "Mac: wrong hex password: " + h.hex
            }
            g = h.hex
        }
        if (h.utf8 !== undefined) {
            g = utf8tohex(h.utf8)
        }
        if (h.rstr !== undefined) {
            g = rstrtohex(h.rstr)
        }
        if (h.b64 !== undefined) {
            g = b64tohex(h.b64)
        }
        if (h.b64u !== undefined) {
            g = b64utohex(h.b64u)
        }
        if (g == null) {
            throw "KJUR.crypto.Mac unsupported password type: " + h
        }
        this.pass = CryptoJS.enc.Hex.parse(g)
    }
    ;
    if (d !== undefined) {
        if (d.pass !== undefined) {
            this.setPassword(d.pass)
        }
        if (d.alg !== undefined) {
            this.algName = d.alg;
            if (d.prov === undefined) {
                this.provName = KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]
            }
            this.setAlgAndProvider(this.algName, this.provName)
        }
    }
}
;
KJUR.crypto.Signature = function(o) {
    var q = null;
    var n = null;
    var r = null;
    var c = null;
    var l = null;
    var d = null;
    var k = null;
    var h = null;
    var p = null;
    var e = null;
    var b = -1;
    var g = null;
    var j = null;
    var a = null;
    var i = null;
    var f = null;
    this._setAlgNames = function() {
        var s = this.algName.match(/^(.+)with(.+)$/);
        if (s) {
            this.mdAlgName = s[1].toLowerCase();
            this.pubkeyAlgName = s[2].toLowerCase()
        }
    }
    ;
    this._zeroPaddingOfSignature = function(x, w) {
        var v = "";
        var t = w / 4 - x.length;
        for (var u = 0; u < t; u++) {
            v = v + "0"
        }
        return v + x
    }
    ;
    this.setAlgAndProvider = function(u, t) {
        this._setAlgNames();
        if (t != "cryptojs/jsrsa") {
            throw "provider not supported: " + t
        }
        if (":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName) != -1) {
            try {
                this.md = new KJUR.crypto.MessageDigest({
                    alg: this.mdAlgName
                })
            } catch (s) {
                throw "setAlgAndProvider hash alg set fail alg=" + this.mdAlgName + "/" + s
            }
            this.init = function(w, x) {
                var y = null;
                try {
                    if (x === undefined) {
                        y = KEYUTIL.getKey(w)
                    } else {
                        y = KEYUTIL.getKey(w, x)
                    }
                } catch (v) {
                    throw "init failed:" + v
                }
                if (y.isPrivate === true) {
                    this.prvKey = y;
                    this.state = "SIGN"
                } else {
                    if (y.isPublic === true) {
                        this.pubKey = y;
                        this.state = "VERIFY"
                    } else {
                        throw "init failed.:" + y
                    }
                }
            }
            ;
            this.updateString = function(v) {
                this.md.updateString(v)
            }
            ;
            this.updateHex = function(v) {
                this.md.updateHex(v)
            }
            ;
            this.sign = function() {
                this.sHashHex = this.md.digest();
                if (typeof this.ecprvhex != "undefined" && typeof this.eccurvename != "undefined") {
                    var v = new KJUR.crypto.ECDSA({
                        curve: this.eccurvename
                    });
                    this.hSign = v.signHex(this.sHashHex, this.ecprvhex)
                } else {
                    if (this.prvKey instanceof RSAKey && this.pubkeyAlgName === "rsaandmgf1") {
                        this.hSign = this.prvKey.signWithMessageHashPSS(this.sHashHex, this.mdAlgName, this.pssSaltLen)
                    } else {
                        if (this.prvKey instanceof RSAKey && this.pubkeyAlgName === "rsa") {
                            this.hSign = this.prvKey.signWithMessageHash(this.sHashHex, this.mdAlgName)
                        } else {
                            if (this.prvKey instanceof KJUR.crypto.ECDSA) {
                                this.hSign = this.prvKey.signWithMessageHash(this.sHashHex)
                            } else {
                                if (this.prvKey instanceof KJUR.crypto.DSA) {
                                    this.hSign = this.prvKey.signWithMessageHash(this.sHashHex)
                                } else {
                                    throw "Signature: unsupported private key alg: " + this.pubkeyAlgName
                                }
                            }
                        }
                    }
                }
                return this.hSign
            }
            ;
            this.signString = function(v) {
                this.updateString(v);
                return this.sign()
            }
            ;
            this.signHex = function(v) {
                this.updateHex(v);
                return this.sign()
            }
            ;
            this.verify = function(v) {
                this.sHashHex = this.md.digest();
                if (typeof this.ecpubhex != "undefined" && typeof this.eccurvename != "undefined") {
                    var w = new KJUR.crypto.ECDSA({
                        curve: this.eccurvename
                    });
                    return w.verifyHex(this.sHashHex, v, this.ecpubhex)
                } else {
                    if (this.pubKey instanceof RSAKey && this.pubkeyAlgName === "rsaandmgf1") {
                        return this.pubKey.verifyWithMessageHashPSS(this.sHashHex, v, this.mdAlgName, this.pssSaltLen)
                    } else {
                        if (this.pubKey instanceof RSAKey && this.pubkeyAlgName === "rsa") {
                            return this.pubKey.verifyWithMessageHash(this.sHashHex, v)
                        } else {
                            if (KJUR.crypto.ECDSA !== undefined && this.pubKey instanceof KJUR.crypto.ECDSA) {
                                return this.pubKey.verifyWithMessageHash(this.sHashHex, v)
                            } else {
                                if (KJUR.crypto.DSA !== undefined && this.pubKey instanceof KJUR.crypto.DSA) {
                                    return this.pubKey.verifyWithMessageHash(this.sHashHex, v)
                                } else {
                                    throw "Signature: unsupported public key alg: " + this.pubkeyAlgName
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    ;
    this.init = function(s, t) {
        throw "init(key, pass) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.updateString = function(s) {
        throw "updateString(str) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.updateHex = function(s) {
        throw "updateHex(hex) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.sign = function() {
        throw "sign() not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.signString = function(s) {
        throw "digestString(str) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.signHex = function(s) {
        throw "digestHex(hex) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.verify = function(s) {
        throw "verify(hSigVal) not supported for this alg:prov=" + this.algProvName
    }
    ;
    this.initParams = o;
    if (o !== undefined) {
        if (o.alg !== undefined) {
            this.algName = o.alg;
            if (o.prov === undefined) {
                this.provName = KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]
            } else {
                this.provName = o.prov
            }
            this.algProvName = this.algName + ":" + this.provName;
            this.setAlgAndProvider(this.algName, this.provName);
            this._setAlgNames()
        }
        if (o.psssaltlen !== undefined) {
            this.pssSaltLen = o.psssaltlen
        }
        if (o.prvkeypem !== undefined) {
            if (o.prvkeypas !== undefined) {
                throw "both prvkeypem and prvkeypas parameters not supported"
            } else {
                try {
                    var q = KEYUTIL.getKey(o.prvkeypem);
                    this.init(q)
                } catch (m) {
                    throw "fatal error to load pem private key: " + m
                }
            }
        }
    }
}
;
KJUR.crypto.Cipher = function(a) {}
;
KJUR.crypto.Cipher.encrypt = function(e, f, d) {
    if (f instanceof RSAKey && f.isPublic) {
        var c = KJUR.crypto.Cipher.getAlgByKeyAndName(f, d);
        if (c === "RSA") {
            return f.encrypt(e)
        }
        if (c === "RSAOAEP") {
            return f.encryptOAEP(e, "sha1")
        }
        var b = c.match(/^RSAOAEP(\d+)$/);
        if (b !== null) {
            return f.encryptOAEP(e, "sha" + b[1])
        }
        throw "Cipher.encrypt: unsupported algorithm for RSAKey: " + d
    } else {
        throw "Cipher.encrypt: unsupported key or algorithm"
    }
}
;
KJUR.crypto.Cipher.decrypt = function(e, f, d) {
    if (f instanceof RSAKey && f.isPrivate) {
        var c = KJUR.crypto.Cipher.getAlgByKeyAndName(f, d);
        if (c === "RSA") {
            return f.decrypt(e)
        }
        if (c === "RSAOAEP") {
            return f.decryptOAEP(e, "sha1")
        }
        var b = c.match(/^RSAOAEP(\d+)$/);
        if (b !== null) {
            return f.decryptOAEP(e, "sha" + b[1])
        }
        throw "Cipher.decrypt: unsupported algorithm for RSAKey: " + d
    } else {
        throw "Cipher.decrypt: unsupported key or algorithm"
    }
}
;
KJUR.crypto.Cipher.getAlgByKeyAndName = function(b, a) {
    if (b instanceof RSAKey) {
        if (":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(a) != -1) {
            return a
        }
        if (a === null || a === undefined) {
            return "RSA"
        }
        throw "getAlgByKeyAndName: not supported algorithm name for RSAKey: " + a
    }
    throw "getAlgByKeyAndName: not supported algorithm name: " + a
}
;
KJUR.crypto.OID = new function() {
    this.oidhex2name = {
        "2a864886f70d010101": "rsaEncryption",
        "2a8648ce3d0201": "ecPublicKey",
        "2a8648ce380401": "dsa",
        "2a8648ce3d030107": "secp256r1",
        "2b8104001f": "secp192k1",
        "2b81040021": "secp224r1",
        "2b8104000a": "secp256k1",
        "2b81040023": "secp521r1",
        "2b81040022": "secp384r1",
        "2a8648ce380403": "SHA1withDSA",
        "608648016503040301": "SHA224withDSA",
        "608648016503040302": "SHA256withDSA",
    }
}
;
















var ASN1HEX = new function() {}
;
ASN1HEX.getLblen = function(c, a) {
    if (c.substr(a + 2, 1) != "8") {
        return 1
    }
    var b = parseInt(c.substr(a + 3, 1));
    if (b == 0) {
        return -1
    }
    if (0 < b && b < 10) {
        return b + 1
    }
    return -2
}
;
ASN1HEX.getL = function(c, b) {
    var a = ASN1HEX.getLblen(c, b);
    if (a < 1) {
        return ""
    }
    return c.substr(b + 2, a * 2)
}
;
ASN1HEX.getVblen = function(d, a) {
    var c, b;
    c = ASN1HEX.getL(d, a);
    if (c == "") {
        return -1
    }
    if (c.substr(0, 1) === "8") {
        b = new BigInteger(c.substr(2),16)
    } else {
        b = new BigInteger(c,16)
    }
    return b.intValue()
}
;
ASN1HEX.getVidx = function(c, b) {
    var a = ASN1HEX.getLblen(c, b);
    if (a < 0) {
        return a
    }
    return b + (a + 1) * 2
}
;
ASN1HEX.getV = function(d, a) {
    var c = ASN1HEX.getVidx(d, a);
    var b = ASN1HEX.getVblen(d, a);
    return d.substr(c, b * 2)
}
;
ASN1HEX.getTLV = function(b, a) {
    return b.substr(a, 2) + ASN1HEX.getL(b, a) + ASN1HEX.getV(b, a)
}
;
ASN1HEX.getNextSiblingIdx = function(d, a) {
    var c = ASN1HEX.getVidx(d, a);
    var b = ASN1HEX.getVblen(d, a);
    return c + b * 2
}
;
ASN1HEX.getChildIdx = function(e, f) {
    var j = ASN1HEX;
    var g = new Array();
    var i = j.getVidx(e, f);
    if (e.substr(f, 2) == "03") {
        g.push(i + 2)
    } else {
        g.push(i)
    }
    var l = j.getVblen(e, f);
    var c = i;
    var d = 0;
    while (1) {
        var b = j.getNextSiblingIdx(e, c);
        if (b == null || (b - i >= (l * 2))) {
            break
        }
        if (d >= 200) {
            break
        }
        g.push(b);
        c = b;
        d++
    }
    return g
}
;
ASN1HEX.getNthChildIdx = function(d, b, e) {
    var c = ASN1HEX.getChildIdx(d, b);
    return c[e]
}
;
ASN1HEX.getIdxbyList = function(e, d, c, i) {
    var g = ASN1HEX;
    var f, b;
    if (c.length == 0) {
        if (i !== undefined) {
            if (e.substr(d, 2) !== i) {
                throw "checking tag doesn't match: " + e.substr(d, 2) + "!=" + i
            }
        }
        return d
    }
    f = c.shift();
    b = g.getChildIdx(e, d);
    return g.getIdxbyList(e, b[f], c, i)
}
;
ASN1HEX.getTLVbyList = function(d, c, b, f) {
    var e = ASN1HEX;
    var a = e.getIdxbyList(d, c, b);
    if (a === undefined) {
        throw "can't find nthList object"
    }
    if (f !== undefined) {
        if (d.substr(a, 2) != f) {
            throw "checking tag doesn't match: " + d.substr(a, 2) + "!=" + f
        }
    }
    return e.getTLV(d, a)
}
;
ASN1HEX.getVbyList = function(e, c, b, g, i) {
    var f = ASN1HEX;
    var a, d;
    a = f.getIdxbyList(e, c, b, g);
    if (a === undefined) {
        throw "can't find nthList object"
    }
    d = f.getV(e, a);
    if (i === true) {
        d = d.substr(2)
    }
    return d
}
;
ASN1HEX.hextooidstr = function(e) {
    var h = function(b, a) {
        if (b.length >= a) {
            return b
        }
        return new Array(a - b.length + 1).join("0") + b
    };
    var l = [];
    var o = e.substr(0, 2);
    var f = parseInt(o, 16);
    l[0] = new String(Math.floor(f / 40));
    l[1] = new String(f % 40);
    var m = e.substr(2);
    var k = [];
    for (var g = 0; g < m.length / 2; g++) {
        k.push(parseInt(m.substr(g * 2, 2), 16))
    }
    var j = [];
    var d = "";
    for (var g = 0; g < k.length; g++) {
        if (k[g] & 128) {
            d = d + h((k[g] & 127).toString(2), 7)
        } else {
            d = d + h((k[g] & 127).toString(2), 7);
            j.push(new String(parseInt(d, 2)));
            d = ""
        }
    }
    var n = l.join(".");
    if (j.length > 0) {
        n = n + "." + j.join(".")
    }
    return n
}
;
ASN1HEX.dump = function(t, c, l, g) {
    var p = ASN1HEX;
    var j = p.getV;
    var y = p.dump;
    var w = p.getChildIdx;
    var e = t;
    if (t instanceof KJUR.asn1.ASN1Object) {
        e = t.getEncodedHex()
    }
    var q = function(A, i) {
        if (A.length <= i * 2) {
            return A
        } else {
            var v = A.substr(0, i) + "..(total " + A.length / 2 + "bytes).." + A.substr(A.length - i, i);
            return v
        }
    };
    if (c === undefined) {
        c = {
            ommit_long_octet: 32
        }
    }
    if (l === undefined) {
        l = 0
    }
    if (g === undefined) {
        g = ""
    }
    var x = c.ommit_long_octet;
    if (e.substr(l, 2) == "01") {
        var h = j(e, l);
        if (h == "00") {
            return g + "BOOLEAN FALSE\n"
        } else {
            return g + "BOOLEAN TRUE\n"
        }
    }
    if (e.substr(l, 2) == "02") {
        var h = j(e, l);
        return g + "INTEGER " + q(h, x) + "\n"
    }
    if (e.substr(l, 2) == "03") {
        var h = j(e, l);
        return g + "BITSTRING " + q(h, x) + "\n"
    }
    if (e.substr(l, 2) == "04") {
        var h = j(e, l);
        if (p.isASN1HEX(h)) {
            var k = g + "OCTETSTRING, encapsulates\n";
            k = k + y(h, c, 0, g + "  ");
            return k
        } else {
            return g + "OCTETSTRING " + q(h, x) + "\n"
        }
    }
    if (e.substr(l, 2) == "05") {
        return g + "NULL\n"
    }
    if (e.substr(l, 2) == "06") {
        var m = j(e, l);
        var a = KJUR.asn1.ASN1Util.oidHexToInt(m);
        var o = KJUR.asn1.x509.OID.oid2name(a);
        var b = a.replace(/\./g, " ");
        if (o != "") {
            return g + "ObjectIdentifier " + o + " (" + b + ")\n"
        } else {
            return g + "ObjectIdentifier (" + b + ")\n"
        }
    }
    if (e.substr(l, 2) == "0c") {
        return g + "UTF8String '" + hextoutf8(j(e, l)) + "'\n"
    }
    if (e.substr(l, 2) == "13") {
        return g + "PrintableString '" + hextoutf8(j(e, l)) + "'\n"
    }
    if (e.substr(l, 2) == "14") {
        return g + "TeletexString '" + hextoutf8(j(e, l)) + "'\n"
    }
    if (e.substr(l, 2) == "16") {
        return g + "IA5String '" + hextoutf8(j(e, l)) + "'\n"
    }
    if (e.substr(l, 2) == "17") {
        return g + "UTCTime " + hextoutf8(j(e, l)) + "\n"
    }
    if (e.substr(l, 2) == "18") {
        return g + "GeneralizedTime " + hextoutf8(j(e, l)) + "\n"
    }
    if (e.substr(l, 2) == "30") {
        if (e.substr(l, 4) == "3000") {
            return g + "SEQUENCE {}\n"
        }
        var k = g + "SEQUENCE\n";
        var d = w(e, l);
        var f = c;
        if ((d.length == 2 || d.length == 3) && e.substr(d[0], 2) == "06" && e.substr(d[d.length - 1], 2) == "04") {
            var o = p.oidname(j(e, d[0]));
            var r = JSON.parse(JSON.stringify(c));
            r.x509ExtName = o;
            f = r
        }
        for (var u = 0; u < d.length; u++) {
            k = k + y(e, f, d[u], g + "  ")
        }
        return k
    }
    if (e.substr(l, 2) == "31") {
        var k = g + "SET\n";
        var d = w(e, l);
        for (var u = 0; u < d.length; u++) {
            k = k + y(e, c, d[u], g + "  ")
        }
        return k
    }
    var z = parseInt(e.substr(l, 2), 16);
    if ((z & 128) != 0) {
        var n = z & 31;
        if ((z & 32) != 0) {
            var k = g + "[" + n + "]\n";
            var d = w(e, l);
            for (var u = 0; u < d.length; u++) {
                k = k + y(e, c, d[u], g + "  ")
            }
            return k
        } else {
            var h = j(e, l);
            if (h.substr(0, 8) == "68747470") {
                h = hextoutf8(h)
            }
            if (c.x509ExtName === "subjectAltName" && n == 2) {
                h = hextoutf8(h)
            }
            var k = g + "[" + n + "] " + h + "\n";
            return k
        }
    }
    return g + "UNKNOWN(" + e.substr(l, 2) + ") " + j(e, l) + "\n"
}
;
ASN1HEX.isASN1HEX = function(e) {
    var d = ASN1HEX;
    if (e.length % 2 == 1) {
        return false
    }
    var c = d.getVblen(e, 0);
    var b = e.substr(0, 2);
    var f = d.getL(e, 0);
    var a = e.length - b.length - f.length;
    if (a == c * 2) {
        return true
    }
    return false
}
;
ASN1HEX.oidname = function(a) {
    var c = KJUR.asn1;
    if (KJUR.lang.String.isHex(a)) {
        a = c.ASN1Util.oidHexToInt(a)
    }
    var b = c.x509.OID.oid2name(a);
    if (b === "") {
        b = a
    }
    return b
}
;










var KEYUTIL = function() {
    var d = function(p, r, q) {
        return k(CryptoJS.AES, p, r, q)
    };
    var e = function(p, r, q) {
        return k(CryptoJS.TripleDES, p, r, q)
    };
    var a = function(p, r, q) {
        return k(CryptoJS.DES, p, r, q)
    };
    var k = function(s, x, u, q) {
        var r = CryptoJS.enc.Hex.parse(x);
        var w = CryptoJS.enc.Hex.parse(u);
        var p = CryptoJS.enc.Hex.parse(q);
        var t = {};
        t.key = w;
        t.iv = p;
        t.ciphertext = r;
        var v = s.decrypt(t, w, {
            iv: p
        });
        return CryptoJS.enc.Hex.stringify(v)
    };
    var l = function(p, r, q) {
        return g(CryptoJS.AES, p, r, q)
    };
    var o = function(p, r, q) {
        return g(CryptoJS.TripleDES, p, r, q)
    };
    var f = function(p, r, q) {
        return g(CryptoJS.DES, p, r, q)
    };
    var g = function(t, y, v, q) {
        var s = CryptoJS.enc.Hex.parse(y);
        var x = CryptoJS.enc.Hex.parse(v);
        var p = CryptoJS.enc.Hex.parse(q);
        var w = t.encrypt(s, x, {
            iv: p
        });
        var r = CryptoJS.enc.Hex.parse(w.toString());
        var u = CryptoJS.enc.Base64.stringify(r);
        return u
    };
    var i = {
        "AES-256-CBC": {
            proc: d,
            eproc: l,
            keylen: 32,
            ivlen: 16
        },
        "AES-192-CBC": {
            proc: d,
            eproc: l,
            keylen: 24,
            ivlen: 16
        },
        "AES-128-CBC": {
            proc: d,
            eproc: l,
            keylen: 16,
            ivlen: 16
        },
        "DES-EDE3-CBC": {
            proc: e,
            eproc: o,
            keylen: 24,
            ivlen: 8
        },
        "DES-CBC": {
            proc: a,
            eproc: f,
            keylen: 8,
            ivlen: 8
        }
    };
    var c = function(p) {
        return i[p]["proc"]
    };
    var m = function(p) {
        var r = CryptoJS.lib.WordArray.random(p);
        var q = CryptoJS.enc.Hex.stringify(r);
        return q
    };
    var n = function(v) {
        var w = {};
        var q = v.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));
        if (q) {
            w.cipher = q[1];
            w.ivsalt = q[2]
        }
        var p = v.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));
        if (p) {
            w.type = p[1]
        }
        var u = -1;
        var x = 0;
        if (v.indexOf("\r\n\r\n") != -1) {
            u = v.indexOf("\r\n\r\n");
            x = 2
        }
        if (v.indexOf("\n\n") != -1) {
            u = v.indexOf("\n\n");
            x = 1
        }
        var t = v.indexOf("-----END");
        if (u != -1 && t != -1) {
            var r = v.substring(u + x * 2, t - x);
            r = r.replace(/\s+/g, "");
            w.data = r
        }
        return w
    };
    var j = function(q, y, p) {
        var v = p.substring(0, 16);
        var t = CryptoJS.enc.Hex.parse(v);
        var r = CryptoJS.enc.Utf8.parse(y);
        var u = i[q]["keylen"] + i[q]["ivlen"];
        var x = "";
        var w = null;
        for (; ; ) {
            var s = CryptoJS.algo.MD5.create();
            if (w != null) {
                s.update(w)
            }
            s.update(r);
            s.update(t);
            w = s.finalize();
            x = x + CryptoJS.enc.Hex.stringify(w);
            if (x.length >= u * 2) {
                break
            }
        }
        var z = {};
        z.keyhex = x.substr(0, i[q]["keylen"] * 2);
        z.ivhex = x.substr(i[q]["keylen"] * 2, i[q]["ivlen"] * 2);
        return z
    };
    var b = function(p, v, r, w) {
        var s = CryptoJS.enc.Base64.parse(p);
        var q = CryptoJS.enc.Hex.stringify(s);
        var u = i[v]["proc"];
        var t = u(q, r, w);
        return t
    };
    var h = function(p, s, q, u) {
        var r = i[s]["eproc"];
        var t = r(p, q, u);
        return t
    };
    return {
        version: "1.0.0",
        parsePKCS5PEM: function(p) {
            return n(p)
        },
        getKeyAndUnusedIvByPasscodeAndIvsalt: function(q, p, r) {
            return j(q, p, r)
        },
        decryptKeyB64: function(p, r, q, s) {
            return b(p, r, q, s)
        },
        getDecryptedKeyHex: function(y, x) {
            var q = n(y);
            var t = q.type;
            var r = q.cipher;
            var p = q.ivsalt;
            var s = q.data;
            var w = j(r, x, p);
            var v = w.keyhex;
            var u = b(s, r, v, p);
            return u
        },
        getEncryptedPKCS5PEMFromPrvKeyHex: function(x, s, A, t, r) {
            var p = "";
            if (typeof t == "undefined" || t == null) {
                t = "AES-256-CBC"
            }
            if (typeof i[t] == "undefined") {
                throw "KEYUTIL unsupported algorithm: " + t
            }
            if (typeof r == "undefined" || r == null) {
                var v = i[t]["ivlen"];
                var u = m(v);
                r = u.toUpperCase()
            }
            var z = j(t, A, r);
            var y = z.keyhex;
            var w = h(s, t, y, r);
            var q = w.replace(/(.{64})/g, "$1\r\n");
            var p = "-----BEGIN " + x + " PRIVATE KEY-----\r\n";
            p += "Proc-Type: 4,ENCRYPTED\r\n";
            p += "DEK-Info: " + t + "," + r + "\r\n";
            p += "\r\n";
            p += q;
            p += "\r\n-----END " + x + " PRIVATE KEY-----\r\n";
            return p
        },
        parseHexOfEncryptedPKCS8: function(y) {
            var B = ASN1HEX;
            var z = B.getChildIdx;
            var w = B.getV;
            var t = {};
            var r = z(y, 0);
            if (r.length != 2) {
                throw "malformed format: SEQUENCE(0).items != 2: " + r.length
            }
            t.ciphertext = w(y, r[1]);
            var A = z(y, r[0]);
            if (A.length != 2) {
                throw "malformed format: SEQUENCE(0.0).items != 2: " + A.length
            }
            if (w(y, A[0]) != "2a864886f70d01050d") {
                throw "this only supports pkcs5PBES2"
            }
            var p = z(y, A[1]);
            if (A.length != 2) {
                throw "malformed format: SEQUENCE(0.0.1).items != 2: " + p.length
            }
            var q = z(y, p[1]);
            if (q.length != 2) {
                throw "malformed format: SEQUENCE(0.0.1.1).items != 2: " + q.length
            }
            if (w(y, q[0]) != "2a864886f70d0307") {
                throw "this only supports TripleDES"
            }
            t.encryptionSchemeAlg = "TripleDES";
            t.encryptionSchemeIV = w(y, q[1]);
            var s = z(y, p[0]);
            if (s.length != 2) {
                throw "malformed format: SEQUENCE(0.0.1.0).items != 2: " + s.length
            }
            if (w(y, s[0]) != "2a864886f70d01050c") {
                throw "this only supports pkcs5PBKDF2"
            }
            var x = z(y, s[1]);
            if (x.length < 2) {
                throw "malformed format: SEQUENCE(0.0.1.0.1).items < 2: " + x.length
            }
            t.pbkdf2Salt = w(y, x[0]);
            var u = w(y, x[1]);
            try {
                t.pbkdf2Iter = parseInt(u, 16)
            } catch (v) {
                throw "malformed format pbkdf2Iter: " + u
            }
            return t
        },
        getPBKDF2KeyHexFromParam: function(u, p) {
            var t = CryptoJS.enc.Hex.parse(u.pbkdf2Salt);
            var q = u.pbkdf2Iter;
            var s = CryptoJS.PBKDF2(p, t, {
                keySize: 192 / 32,
                iterations: q
            });
            var r = CryptoJS.enc.Hex.stringify(s);
            return r
        },
        _getPlainPKCS8HexFromEncryptedPKCS8PEM: function(x, y) {
            var r = pemtohex(x, "ENCRYPTED PRIVATE KEY");
            var p = this.parseHexOfEncryptedPKCS8(r);
            var u = KEYUTIL.getPBKDF2KeyHexFromParam(p, y);
            var v = {};
            v.ciphertext = CryptoJS.enc.Hex.parse(p.ciphertext);
            var t = CryptoJS.enc.Hex.parse(u);
            var s = CryptoJS.enc.Hex.parse(p.encryptionSchemeIV);
            var w = CryptoJS.TripleDES.decrypt(v, t, {
                iv: s
            });
            var q = CryptoJS.enc.Hex.stringify(w);
            return q
        },
        getKeyFromEncryptedPKCS8PEM: function(s, q) {
            var p = this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s, q);
            var r = this.getKeyFromPlainPrivatePKCS8Hex(p);
            return r
        },
        parsePlainPrivatePKCS8Hex: function(s) {
            var v = ASN1HEX;
            var u = v.getChildIdx;
            var t = v.getV;
            var q = {};
            q.algparam = null;
            if (s.substr(0, 2) != "30") {
                throw "malformed plain PKCS8 private key(code:001)"
            }
            var r = u(s, 0);
            if (r.length != 3) {
                throw "malformed plain PKCS8 private key(code:002)"
            }
            if (s.substr(r[1], 2) != "30") {
                throw "malformed PKCS8 private key(code:003)"
            }
            var p = u(s, r[1]);
            if (p.length != 2) {
                throw "malformed PKCS8 private key(code:004)"
            }
            if (s.substr(p[0], 2) != "06") {
                throw "malformed PKCS8 private key(code:005)"
            }
            q.algoid = t(s, p[0]);
            if (s.substr(p[1], 2) == "06") {
                q.algparam = t(s, p[1])
            }
            if (s.substr(r[2], 2) != "04") {
                throw "malformed PKCS8 private key(code:006)"
            }
            q.keyidx = v.getVidx(s, r[2]);
            return q
        },
        getKeyFromPlainPrivatePKCS8PEM: function(q) {
            var p = pemtohex(q, "PRIVATE KEY");
            var r = this.getKeyFromPlainPrivatePKCS8Hex(p);
            return r
        },
        getKeyFromPlainPrivatePKCS8Hex: function(p) {
            var q = this.parsePlainPrivatePKCS8Hex(p);
            var r;
            if (q.algoid == "2a864886f70d010101") {
                r = new RSAKey()
            } else {
                if (q.algoid == "2a8648ce380401") {
                    r = new KJUR.crypto.DSA()
                } else {
                    if (q.algoid == "2a8648ce3d0201") {
                        r = new KJUR.crypto.ECDSA()
                    } else {
                        throw "unsupported private key algorithm"
                    }
                }
            }
            r.readPKCS8PrvKeyHex(p);
            return r
        },
        _getKeyFromPublicPKCS8Hex: function(q) {
            var p;
            var r = ASN1HEX.getVbyList(q, 0, [0, 0], "06");
            if (r === "2a864886f70d010101") {
                p = new RSAKey()
            } else {
                if (r === "2a8648ce380401") {
                    p = new KJUR.crypto.DSA()
                } else {
                    if (r === "2a8648ce3d0201") {
                        p = new KJUR.crypto.ECDSA()
                    } else {
                        throw "unsupported PKCS#8 public key hex"
                    }
                }
            }
            p.readPKCS8PubKeyHex(q);
            return p
        },
        parsePublicRawRSAKeyHex: function(r) {
            var u = ASN1HEX;
            var t = u.getChildIdx;
            var s = u.getV;
            var p = {};
            if (r.substr(0, 2) != "30") {
                throw "malformed RSA key(code:001)"
            }
            var q = t(r, 0);
            if (q.length != 2) {
                throw "malformed RSA key(code:002)"
            }
            if (r.substr(q[0], 2) != "02") {
                throw "malformed RSA key(code:003)"
            }
            p.n = s(r, q[0]);
            if (r.substr(q[1], 2) != "02") {
                throw "malformed RSA key(code:004)"
            }
            p.e = s(r, q[1]);
            return p
        },
        parsePublicPKCS8Hex: function(t) {
            var v = ASN1HEX;
            var u = v.getChildIdx;
            var s = v.getV;
            var q = {};
            q.algparam = null;
            var r = u(t, 0);
            if (r.length != 2) {
                throw "outer DERSequence shall have 2 elements: " + r.length
            }
            var w = r[0];
            if (t.substr(w, 2) != "30") {
                throw "malformed PKCS8 public key(code:001)"
            }
            var p = u(t, w);
            if (p.length != 2) {
                throw "malformed PKCS8 public key(code:002)"
            }
            if (t.substr(p[0], 2) != "06") {
                throw "malformed PKCS8 public key(code:003)"
            }
            q.algoid = s(t, p[0]);
            if (t.substr(p[1], 2) == "06") {
                q.algparam = s(t, p[1])
            } else {
                if (t.substr(p[1], 2) == "30") {
                    q.algparam = {};
                    q.algparam.p = v.getVbyList(t, p[1], [0], "02");
                    q.algparam.q = v.getVbyList(t, p[1], [1], "02");
                    q.algparam.g = v.getVbyList(t, p[1], [2], "02")
                }
            }
            if (t.substr(r[1], 2) != "03") {
                throw "malformed PKCS8 public key(code:004)"
            }
            q.key = s(t, r[1]).substr(2);
            return q
        },
    }
}();
KEYUTIL.getKey = function(l, k, n) {
    var G = ASN1HEX
        , L = G.getChildIdx
        , v = G.getV
        , d = G.getVbyList
        , c = KJUR.crypto
        , i = c.ECDSA
        , C = c.DSA
        , w = RSAKey
        , M = pemtohex
        , F = KEYUTIL;
    if (typeof w != "undefined" && l instanceof w) {
        return l
    }
    if (typeof i != "undefined" && l instanceof i) {
        return l
    }
    if (typeof C != "undefined" && l instanceof C) {
        return l
    }
    if (l.curve !== undefined && l.xy !== undefined && l.d === undefined) {
        return new i({
            pub: l.xy,
            curve: l.curve
        })
    }
    if (l.curve !== undefined && l.d !== undefined) {
        return new i({
            prv: l.d,
            curve: l.curve
        })
    }
    if (l.kty === undefined && l.n !== undefined && l.e !== undefined && l.d === undefined) {
        var P = new w();
        P.setPublic(l.n, l.e);
        return P
    }
    if (l.kty === undefined && l.n !== undefined && l.e !== undefined && l.d !== undefined && l.p !== undefined && l.q !== undefined && l.dp !== undefined && l.dq !== undefined && l.co !== undefined && l.qi === undefined) {
        var P = new w();
        P.setPrivateEx(l.n, l.e, l.d, l.p, l.q, l.dp, l.dq, l.co);
        return P
    }
    if (l.kty === undefined && l.n !== undefined && l.e !== undefined && l.d !== undefined && l.p === undefined) {
        var P = new w();
        P.setPrivate(l.n, l.e, l.d);
        return P
    }
    if (l.p !== undefined && l.q !== undefined && l.g !== undefined && l.y !== undefined && l.x === undefined) {
        var P = new C();
        P.setPublic(l.p, l.q, l.g, l.y);
        return P
    }
    if (l.p !== undefined && l.q !== undefined && l.g !== undefined && l.y !== undefined && l.x !== undefined) {
        var P = new C();
        P.setPrivate(l.p, l.q, l.g, l.y, l.x);
        return P
    }
    if (l.kty === "RSA" && l.n !== undefined && l.e !== undefined && l.d === undefined) {
        var P = new w();
        P.setPublic(b64utohex(l.n), b64utohex(l.e));
        return P
    }
    if (l.kty === "RSA" && l.n !== undefined && l.e !== undefined && l.d !== undefined && l.p !== undefined && l.q !== undefined && l.dp !== undefined && l.dq !== undefined && l.qi !== undefined) {
        var P = new w();
        P.setPrivateEx(b64utohex(l.n), b64utohex(l.e), b64utohex(l.d), b64utohex(l.p), b64utohex(l.q), b64utohex(l.dp), b64utohex(l.dq), b64utohex(l.qi));
        return P
    }
    if (l.kty === "RSA" && l.n !== undefined && l.e !== undefined && l.d !== undefined) {
        var P = new w();
        P.setPrivate(b64utohex(l.n), b64utohex(l.e), b64utohex(l.d));
        return P
    }
    if (l.kty === "EC" && l.crv !== undefined && l.x !== undefined && l.y !== undefined && l.d === undefined) {
        var j = new i({
            curve: l.crv
        });
        var t = j.ecparams.keylen / 4;
        var B = ("0000000000" + b64utohex(l.x)).slice(-t);
        var z = ("0000000000" + b64utohex(l.y)).slice(-t);
        var u = "04" + B + z;
        j.setPublicKeyHex(u);
        return j
    }
    if (l.kty === "EC" && l.crv !== undefined && l.x !== undefined && l.y !== undefined && l.d !== undefined) {
        var j = new i({
            curve: l.crv
        });
        var t = j.ecparams.keylen / 4;
        var B = ("0000000000" + b64utohex(l.x)).slice(-t);
        var z = ("0000000000" + b64utohex(l.y)).slice(-t);
        var u = "04" + B + z;
        var b = ("0000000000" + b64utohex(l.d)).slice(-t);
        j.setPublicKeyHex(u);
        j.setPrivateKeyHex(b);
        return j
    }
    if (n === "pkcs5prv") {
        var J = l, G = ASN1HEX, N, P;
        N = L(J, 0);
        if (N.length === 9) {
            P = new w();
            P.readPKCS5PrvKeyHex(J)
        } else {
            if (N.length === 6) {
                P = new C();
                P.readPKCS5PrvKeyHex(J)
            } else {
                if (N.length > 2 && J.substr(N[1], 2) === "04") {
                    P = new i();
                    P.readPKCS5PrvKeyHex(J)
                } else {
                    throw "unsupported PKCS#1/5 hexadecimal key"
                }
            }
        }
        return P
    }
    if (n === "pkcs8prv") {
        var P = F.getKeyFromPlainPrivatePKCS8Hex(l);
        return P
    }
    if (n === "pkcs8pub") {
        return F._getKeyFromPublicPKCS8Hex(l)
    }
    if (n === "x509pub") {
        return X509.getPublicKeyFromCertHex(l)
    }
    if (l.indexOf("-END CERTIFICATE-", 0) != -1 || l.indexOf("-END X509 CERTIFICATE-", 0) != -1 || l.indexOf("-END TRUSTED CERTIFICATE-", 0) != -1) {
        return X509.getPublicKeyFromCertPEM(l)
    }
    if (l.indexOf("-END PUBLIC KEY-") != -1) {
        var O = pemtohex(l, "PUBLIC KEY");
        return F._getKeyFromPublicPKCS8Hex(O)
    }
    if (l.indexOf("-END RSA PRIVATE KEY-") != -1 && l.indexOf("4,ENCRYPTED") == -1) {
        var m = M(l, "RSA PRIVATE KEY");
        return F.getKey(m, null, "pkcs5prv")
    }
    if (l.indexOf("-END DSA PRIVATE KEY-") != -1 && l.indexOf("4,ENCRYPTED") == -1) {
        var I = M(l, "DSA PRIVATE KEY");
        var E = d(I, 0, [1], "02");
        var D = d(I, 0, [2], "02");
        var K = d(I, 0, [3], "02");
        var r = d(I, 0, [4], "02");
        var s = d(I, 0, [5], "02");
        var P = new C();
        P.setPrivate(new BigInteger(E,16), new BigInteger(D,16), new BigInteger(K,16), new BigInteger(r,16), new BigInteger(s,16));
        return P
    }
    if (l.indexOf("-END PRIVATE KEY-") != -1) {
        return F.getKeyFromPlainPrivatePKCS8PEM(l)
    }
    if (l.indexOf("-END RSA PRIVATE KEY-") != -1 && l.indexOf("4,ENCRYPTED") != -1) {
        var o = F.getDecryptedKeyHex(l, k);
        var H = new RSAKey();
        H.readPKCS5PrvKeyHex(o);
        return H
    }
    if (l.indexOf("-END EC PRIVATE KEY-") != -1 && l.indexOf("4,ENCRYPTED") != -1) {
        var I = F.getDecryptedKeyHex(l, k);
        var P = d(I, 0, [1], "04");
        var f = d(I, 0, [2, 0], "06");
        var A = d(I, 0, [3, 0], "03").substr(2);
        var e = "";
        if (KJUR.crypto.OID.oidhex2name[f] !== undefined) {
            e = KJUR.crypto.OID.oidhex2name[f]
        } else {
            throw "undefined OID(hex) in KJUR.crypto.OID: " + f
        }
        var j = new i({
            curve: e
        });
        j.setPublicKeyHex(A);
        j.setPrivateKeyHex(P);
        j.isPublic = false;
        return j
    }
    if (l.indexOf("-END DSA PRIVATE KEY-") != -1 && l.indexOf("4,ENCRYPTED") != -1) {
        var I = F.getDecryptedKeyHex(l, k);
        var E = d(I, 0, [1], "02");
        var D = d(I, 0, [2], "02");
        var K = d(I, 0, [3], "02");
        var r = d(I, 0, [4], "02");
        var s = d(I, 0, [5], "02");
        var P = new C();
        P.setPrivate(new BigInteger(E,16), new BigInteger(D,16), new BigInteger(K,16), new BigInteger(r,16), new BigInteger(s,16));
        return P
    }
    if (l.indexOf("-END ENCRYPTED PRIVATE KEY-") != -1) {
        return F.getKeyFromEncryptedPKCS8PEM(l, k)
    }
    throw "not supported argument"
}
;
KEYUTIL.generateKeypair = function(a, c) {
    if (a == "RSA") {
        var b = c;
        var h = new RSAKey();
        h.generate(b, "10001");
        h.isPrivate = true;
        h.isPublic = true;
        var f = new RSAKey();
        var e = h.n.toString(16);
        var i = h.e.toString(16);
        f.setPublic(e, i);
        f.isPrivate = false;
        f.isPublic = true;
        var k = {};
        k.prvKeyObj = h;
        k.pubKeyObj = f;
        return k
    } else {
        if (a == "EC") {
            var d = c;
            var g = new KJUR.crypto.ECDSA({
                curve: d
            });
            var j = g.generateKeyPairHex();
            var h = new KJUR.crypto.ECDSA({
                curve: d
            });
            h.setPublicKeyHex(j.ecpubhex);
            h.setPrivateKeyHex(j.ecprvhex);
            h.isPrivate = true;
            h.isPublic = false;
            var f = new KJUR.crypto.ECDSA({
                curve: d
            });
            f.setPublicKeyHex(j.ecpubhex);
            f.isPrivate = false;
            f.isPublic = true;
            var k = {};
            k.prvKeyObj = h;
            k.pubKeyObj = f;
            return k
        } else {
            throw "unknown algorithm: " + a
        }
    }
}
;
KEYUTIL.getPEM = function(b, D, y, m, q, j) {
    var F = KJUR
        , k = F.asn1
        , z = k.DERObjectIdentifier
        , f = k.DERInteger
        , l = k.ASN1Util.newObject
        , a = k.x509
        , C = a.SubjectPublicKeyInfo
        , e = F.crypto
        , u = e.DSA
        , r = e.ECDSA
        , n = RSAKey;
    function A(s) {
        var G = l({
            seq: [{
                "int": 0
            }, {
                "int": {
                    bigint: s.n
                }
            }, {
                "int": s.e
            }, {
                "int": {
                    bigint: s.d
                }
            }, {
                "int": {
                    bigint: s.p
                }
            }, {
                "int": {
                    bigint: s.q
                }
            }, {
                "int": {
                    bigint: s.dmp1
                }
            }, {
                "int": {
                    bigint: s.dmq1
                }
            }, {
                "int": {
                    bigint: s.coeff
                }
            }]
        });
        return G
    }
    function B(G) {
        var s = l({
            seq: [{
                "int": 1
            }, {
                octstr: {
                    hex: G.prvKeyHex
                }
            }, {
                tag: ["a0", true, {
                    oid: {
                        name: G.curveName
                    }
                }]
            }, {
                tag: ["a1", true, {
                    bitstr: {
                        hex: "00" + G.pubKeyHex
                    }
                }]
            }]
        });
        return s
    }
    function x(s) {
        var G = l({
            seq: [{
                "int": 0
            }, {
                "int": {
                    bigint: s.p
                }
            }, {
                "int": {
                    bigint: s.q
                }
            }, {
                "int": {
                    bigint: s.g
                }
            }, {
                "int": {
                    bigint: s.y
                }
            }, {
                "int": {
                    bigint: s.x
                }
            }]
        });
        return G
    }
    if (((n !== undefined && b instanceof n) || (u !== undefined && b instanceof u) || (r !== undefined && b instanceof r)) && b.isPublic == true && (D === undefined || D == "PKCS8PUB")) {
        var E = new C(b);
        var w = E.getEncodedHex();
        return hextopem(w, "PUBLIC KEY")
    }
    if (D == "PKCS1PRV" && n !== undefined && b instanceof n && (y === undefined || y == null) && b.isPrivate == true) {
        var E = A(b);
        var w = E.getEncodedHex();
        return hextopem(w, "RSA PRIVATE KEY")
    }
    if (D == "PKCS1PRV" && r !== undefined && b instanceof r && (y === undefined || y == null) && b.isPrivate == true) {
        var i = new z({
            name: b.curveName
        });
        var v = i.getEncodedHex();
        var h = B(b);
        var t = h.getEncodedHex();
        var p = "";
        p += hextopem(v, "EC PARAMETERS");
        p += hextopem(t, "EC PRIVATE KEY");
        return p
    }
    if (D == "PKCS1PRV" && u !== undefined && b instanceof u && (y === undefined || y == null) && b.isPrivate == true) {
        var E = x(b);
        var w = E.getEncodedHex();
        return hextopem(w, "DSA PRIVATE KEY")
    }
    if (D == "PKCS5PRV" && n !== undefined && b instanceof n && (y !== undefined && y != null) && b.isPrivate == true) {
        var E = A(b);
        var w = E.getEncodedHex();
        if (m === undefined) {
            m = "DES-EDE3-CBC"
        }
        return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA", w, y, m, j)
    }
    if (D == "PKCS5PRV" && r !== undefined && b instanceof r && (y !== undefined && y != null) && b.isPrivate == true) {
        var E = B(b);
        var w = E.getEncodedHex();
        if (m === undefined) {
            m = "DES-EDE3-CBC"
        }
        return this.getEncryptedPKCS5PEMFromPrvKeyHex("EC", w, y, m, j)
    }
    if (D == "PKCS5PRV" && u !== undefined && b instanceof u && (y !== undefined && y != null) && b.isPrivate == true) {
        var E = x(b);
        var w = E.getEncodedHex();
        if (m === undefined) {
            m = "DES-EDE3-CBC"
        }
        return this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA", w, y, m, j)
    }
    var o = function(G, s) {
        var I = c(G, s);
        var H = new l({
            seq: [{
                seq: [{
                    oid: {
                        name: "pkcs5PBES2"
                    }
                }, {
                    seq: [{
                        seq: [{
                            oid: {
                                name: "pkcs5PBKDF2"
                            }
                        }, {
                            seq: [{
                                octstr: {
                                    hex: I.pbkdf2Salt
                                }
                            }, {
                                "int": I.pbkdf2Iter
                            }]
                        }]
                    }, {
                        seq: [{
                            oid: {
                                name: "des-EDE3-CBC"
                            }
                        }, {
                            octstr: {
                                hex: I.encryptionSchemeIV
                            }
                        }]
                    }]
                }]
            }, {
                octstr: {
                    hex: I.ciphertext
                }
            }]
        });
        return H.getEncodedHex()
    };
    var c = function(N, O) {
        var H = 100;
        var M = CryptoJS.lib.WordArray.random(8);
        var L = "DES-EDE3-CBC";
        var s = CryptoJS.lib.WordArray.random(8);
        var I = CryptoJS.PBKDF2(O, M, {
            keySize: 192 / 32,
            iterations: H
        });
        var J = CryptoJS.enc.Hex.parse(N);
        var K = CryptoJS.TripleDES.encrypt(J, I, {
            iv: s
        }) + "";
        var G = {};
        G.ciphertext = K;
        G.pbkdf2Salt = CryptoJS.enc.Hex.stringify(M);
        G.pbkdf2Iter = H;
        G.encryptionSchemeAlg = L;
        G.encryptionSchemeIV = CryptoJS.enc.Hex.stringify(s);
        return G
    };
    if (D == "PKCS8PRV" && n != undefined && b instanceof n && b.isPrivate == true) {
        var g = A(b);
        var d = g.getEncodedHex();
        var E = l({
            seq: [{
                "int": 0
            }, {
                seq: [{
                    oid: {
                        name: "rsaEncryption"
                    }
                }, {
                    "null": true
                }]
            }, {
                octstr: {
                    hex: d
                }
            }]
        });
        var w = E.getEncodedHex();
        if (y === undefined || y == null) {
            return hextopem(w, "PRIVATE KEY")
        } else {
            var t = o(w, y);
            return hextopem(t, "ENCRYPTED PRIVATE KEY")
        }
    }
    if (D == "PKCS8PRV" && r !== undefined && b instanceof r && b.isPrivate == true) {
        var g = new l({
            seq: [{
                "int": 1
            }, {
                octstr: {
                    hex: b.prvKeyHex
                }
            }, {
                tag: ["a1", true, {
                    bitstr: {
                        hex: "00" + b.pubKeyHex
                    }
                }]
            }]
        });
        var d = g.getEncodedHex();
        var E = l({
            seq: [{
                "int": 0
            }, {
                seq: [{
                    oid: {
                        name: "ecPublicKey"
                    }
                }, {
                    oid: {
                        name: b.curveName
                    }
                }]
            }, {
                octstr: {
                    hex: d
                }
            }]
        });
        var w = E.getEncodedHex();
        if (y === undefined || y == null) {
            return hextopem(w, "PRIVATE KEY")
        } else {
            var t = o(w, y);
            return hextopem(t, "ENCRYPTED PRIVATE KEY")
        }
    }
    if (D == "PKCS8PRV" && u !== undefined && b instanceof u && b.isPrivate == true) {
        var g = new f({
            bigint: b.x
        });
        var d = g.getEncodedHex();
        var E = l({
            seq: [{
                "int": 0
            }, {
                seq: [{
                    oid: {
                        name: "dsa"
                    }
                }, {
                    seq: [{
                        "int": {
                            bigint: b.p
                        }
                    }, {
                        "int": {
                            bigint: b.q
                        }
                    }, {
                        "int": {
                            bigint: b.g
                        }
                    }]
                }]
            }, {
                octstr: {
                    hex: d
                }
            }]
        });
        var w = E.getEncodedHex();
        if (y === undefined || y == null) {
            return hextopem(w, "PRIVATE KEY")
        } else {
            var t = o(w, y);
            return hextopem(t, "ENCRYPTED PRIVATE KEY")
        }
    }
    throw "unsupported object nor format"
}
;
KEYUTIL.getKeyFromCSRPEM = function(b) {
    var a = pemtohex(b, "CERTIFICATE REQUEST");
    var c = KEYUTIL.getKeyFromCSRHex(a);
    return c
}
;
KEYUTIL.getKeyFromCSRHex = function(a) {
    var c = KEYUTIL.parseCSRHex(a);
    var b = KEYUTIL.getKey(c.p8pubkeyhex, null, "pkcs8pub");
    return b
}
;
KEYUTIL.parseCSRHex = function(d) {
    var i = ASN1HEX;
    var f = i.getChildIdx;
    var c = i.getTLV;
    var b = {};
    var g = d;
    if (g.substr(0, 2) != "30") {
        throw "malformed CSR(code:001)"
    }
    var e = f(g, 0);
    if (e.length < 1) {
        throw "malformed CSR(code:002)"
    }
    if (g.substr(e[0], 2) != "30") {
        throw "malformed CSR(code:003)"
    }
    var a = f(g, e[0]);
    if (a.length < 3) {
        throw "malformed CSR(code:004)"
    }
    b.p8pubkeyhex = c(g, a[2]);
    return b
}
;
KEYUTIL.getJWKFromKey = function(d) {
    var b = {};
    if (d instanceof RSAKey && d.isPrivate) {
        b.kty = "RSA";
        b.n = hextob64u(d.n.toString(16));
        b.e = hextob64u(d.e.toString(16));
        b.d = hextob64u(d.d.toString(16));
        b.p = hextob64u(d.p.toString(16));
        b.q = hextob64u(d.q.toString(16));
        b.dp = hextob64u(d.dmp1.toString(16));
        b.dq = hextob64u(d.dmq1.toString(16));
        b.qi = hextob64u(d.coeff.toString(16));
        return b
    } else {
        if (d instanceof RSAKey && d.isPublic) {
            b.kty = "RSA";
            b.n = hextob64u(d.n.toString(16));
            b.e = hextob64u(d.e.toString(16));
            return b
        } else {
            if (d instanceof KJUR.crypto.ECDSA && d.isPrivate) {
                var a = d.getShortNISTPCurveName();
                if (a !== "P-256" && a !== "P-384") {
                    throw "unsupported curve name for JWT: " + a
                }
                var c = d.getPublicKeyXYHex();
                b.kty = "EC";
                b.crv = a;
                b.x = hextob64u(c.x);
                b.y = hextob64u(c.y);
                b.d = hextob64u(d.prvKeyHex);
                return b
            } else {
                if (d instanceof KJUR.crypto.ECDSA && d.isPublic) {
                    var a = d.getShortNISTPCurveName();
                    if (a !== "P-256" && a !== "P-384") {
                        throw "unsupported curve name for JWT: " + a
                    }
                    var c = d.getPublicKeyXYHex();
                    b.kty = "EC";
                    b.crv = a;
                    b.x = hextob64u(c.x);
                    b.y = hextob64u(c.y);
                    return b
                }
            }
        }
    }
    throw "not supported key object"
}
;














































_0xad2e02 = function(_0x8c7424) {
    var  _0x4fd74e = KEYUTIL["getKey"]("-----BEGIN PUBLIC KEY-----\n" +
        "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCigl9qBi6/wNAZLbU/P+7t6AvIyHHHdiOmbbInHrv1ihRXFCpTQLHBg7MoImLGiS858i43T2sMSWnWfG5wfasLtblDPqodL7/O50Z5urICs3/WlbK/qeluHKVwhC3wfq+y1gdOQf+90GFOi3uyF03UhYSiyFlLpfTR13vwR8LBNwIDAQAB\n" +
        "-----END PUBLIC KEY-----")
        , _0x26889a = new KJUR["crypto"]["Signature"]({
        alg: "SHA1withRSA"
    });
    return _0x26889a.init(_0x4fd74e),
        _0x26889a["updateString"](_0x8c7424),
        _0x55c569["PyHXr"](hextob64, _0x26889a.sign());
};


function encryptContent(page, qccppm) {
    let content = {
        "PageSize": "60",
        "IsGetShopOviewInfo": "1",
        "MarketIds": [
            17,
            14
        ],
        "Keyword": "",
        "Sort": 1,
        "IsSpotGoods": 1,
        "page": Number(page)
    }
    _0x23426d = qccppm["split"]("|");
    var _0x307ab8 = _0x23426d[0]
    encryCon = _0x595165(JSON.stringify(content), qccppm)
    sign = _0xad2e02(encryCon)
}
encryptContent(3, "zX9IeVC1BtwYyqVAtZrPc8PsrqZL9bHz|mWViYffnC0Z3btRM|2EDA3E7C5E514428C636D77DFA0AC44E")




















